package com.victor.dao;


import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.victor.entity.toreport.FrozenContent;
import com.victor.entity.toreport.ToReport;


@Mapper
public interface ToreportDao {
	/**
	 * 举报次数
	 * @param uid
	 * @return
	 */
	@Select({"select count(*) from toreport where fromuid=#{uid}"})
	String selByFromuid(String uid);
	/**
	 * 被举报次数
	 * @param uid
	 * @return
	 */
	@Select({"select count(*) from toreport where touid=#{uid}"})
	String selByTouid(String uid);
	/**
	 * 举报取消数
	 * @param uid
	 * @return
	 */
	@Select({"select count(*) from toreport where fromuid=#{uid} and delstate=0"})
	String selByFromuidAndDelstate(String uid);
	/**
	 * 查询违规信息
	 * @param uid
	 * @return
	 */
	@Select({"select * from toreport where touid =#{uid} and delstate=1"})
	List<ToReport> selWrongInfo(String uid);
	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	ToReport selById(String id);
	/**
	 * 修改举报
	 * @param toReport
	 * @return
	 */
	boolean updateByTypeAndCid(ToReport toReport);
	/**
	 * 添加冻结原因
	 * @param frozenContent
	 * @return
	 */
	boolean insertFrozenContent(FrozenContent frozenContent);
	

}
